import 'dart:io';

import 'package:flutter/animation.dart';
import 'package:get/get.dart';
import 'package:mobile_scanner/mobile_scanner.dart';

class QrcodeScannerController extends GetxController {


  MobileScannerController cameraController = MobileScannerController(
    detectionSpeed: DetectionSpeed.normal,
    facing: CameraFacing.back,
    torchEnabled: false,
  );

  // 手电筒是否开启
  final flashlighOn = false.obs;

  _initData() {
    update(["qrcode_scanner"]);
  }


  @override
  void onReady() {
    super.onReady();
    _initData();
  }

  @override
  void onClose() {
    cameraController.dispose();
    super.onClose();
  }
}
